/**
 * Copyright (C) 2021-2022 maminjie <canpool@163.com>
 * SPDX-License-Identifier: LGPL-2.1
 * Powered by Qt-Advanced-Docking-System
**/

#pragma once

#include "qads_global.h"

#include <QPoint>
#include <QSize>

class QWidget;

QADS_BEGIN_NAMESPACE

/**
 * Pure virtual interface for floating widgets.
 * This interface is used for opaque and non-opaque undocking. If opaque
 * undocking is used, the a real DockFloatingWidget widget will be created
 */
class QADS_EXPORT DockFloatingInterface
{
public:
    virtual ~DockFloatingInterface() = default;
    /**
     * Starts floating.
     * This function should get called typically from a mouse press event handler
     */
    virtual void startFloating(const QPoint &dragStartPos, const QSize &size,
                               DragState dragState, QWidget *mouseEventHandler) = 0;

    /**
     * Moves the widget to a new position relative to the position given when startFloating() was called.
     * This function should be called from a mouse move event handler to move the floating widget on mouse move events.
     */
    virtual void moveFloating() = 0;

    /**
     * Tells the widget that to finish dragging if the mouse is released.
     * This function should be called from a mouse release event handler to finish the dragging
     */
    virtual void finishDragging() = 0;
};

QADS_END_NAMESPACE
